package com.yc.sole.erp.enums;

import com.fasterxml.jackson.annotation.JsonValue;
import com.yc.sole.common.enums.IBaseEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author yizuomin
 * @date 2024/3/10 09:04
 **/
@Getter
@AllArgsConstructor
public enum ShipmentState implements IBaseEnum<String> {

    /**
     *
     */
    UN_SHIPPED("0", "未送货"),
    PARTIAL_SHIPPED("1", "部分送货"),
    SHIPPED("2", "已送货");

    @JsonValue
    private final String value;
    private final String description;

    public static String getByValue(String value) {
        for (ShipmentState state : ShipmentState.values()) {
            if (state.getValue().equals(value)) {
                return state.getDescription();
            }
        }
        return null;
    }
}
